let mongoose = require('./index');
let { Schema, Model } = mongoose

const UserSchema = new Schema({
  username: { type: String, required: true, unique: true },
  password: { type: String, required: true },
  role: {
    type: String,
    enum: ['user', 'merchant', 'admin', 'technician'],
    //顺序依次为用户、商家、管理员、技术人员
    default: 'user'
  }
});
const User = mongoose.model('Usersss', UserSchema);
module.exports = User;
